public class First{
	public static void main(String[] args){
	for(int i=100;i<1000;i++){
	int one = i%10;
	int ten = i%100/10;
	int hundred = i%1000/100;
	if(one*one*one+ten*ten*ten+hundred*hundred*hundred==i){
	System.out.println(i);
		}
	}
	}
}